package com.fancon.android.gardenjokesx.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;

import com.fancon.android.gardenjokesx.R;
import com.fancon.android.gardenjokesx.activity.LoginActivity;
import com.fancon.android.gardenjokesx.activity.SignupActivity;

public class FirstLaunchDialog extends Dialog {

	private Context mContext;

	public FirstLaunchDialog(final Context context) {
		super(context, android.R.style.Theme_Translucent_NoTitleBar);
		// TODO Auto-generated constructor stub
		mContext = context;
		setContentView(R.layout.firstlaunch_branding_layout);
		View login = findViewById(R.id.login_fragment_login_button);
		View signup = findViewById(R.id.login_fragment_signup_button);

		login.setOnClickListener(new android.view.View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(context, LoginActivity.class);
				context.startActivity(intent);
			}
		});
		signup.setOnClickListener(new android.view.View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(context, SignupActivity.class);
				context.startActivity(intent);
			}
		});
	}

	@Override
	public void onBackPressed() {
		Log.i("HA", "Finishing");
		dismiss();
		((Activity) mContext).finish();
	}

}
